package com.ymatou.apigateway.testcase;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.shop2cn.iapi.shenqisettlement.parameter.bean.AgentProductBean;
import com.shop2cn.iapi.shenqisettlement.service.DGSQBaseService;
import com.ymatou.apigateway.parameter.AesUtil;
import com.ymatou.apigateway.parameter.CatalogInfo;
import com.ymatou.apigateway.parameter.GetproductListBean;
import com.ymatou.apigateway.parameter.OpenapiReq;
import com.ymatou.apigateway.parameter.ProductInfo;
import com.ymatou.apigateway.parameter.ProductList;
import com.ymatou.apigateway.parameter.PropertyInfo;
import com.ymatou.apigateway.service.OpenapiService;
import com.ymatou.apigateway.service.ShenqiGetProductListCall;
import com.shop2cn.iapi.agentproducts.parameter.OpenProductDto;
import com.shop2cn.iapi.agentproducts.parameter.QueryProductListBean;
import com.shop2cn.iapi.agentproducts.service.QueryProductListCall;
import com.ymt.core.tool.FormatUtil;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymttest.business.service.SellerProductCallService;
import com.ymttest.business.service.shenqi.DGSQBuildProxyChainCallService;
import com.ymttest.business.service.shenqi.bean.ShenqiUserSet;
import com.ymttest.database.model.Application;
import com.ymttest.database.model.AuthCode;
import com.ymttest.database.sqlwapper.OpenApiWapper;
import com.ymttest.utils.DataUtil;
import com.ymttest.utils.EnvSetup;
import com.ymttest.utils.TestDataManager;
import com.ymttest.utils.YMTDateUtil;

/**
 * 获取单个商品详细信息 FreeMaker Template自动生成代码
 */
@TestSuite
public class Ts_sqGetProductList {

	private static OpenapiReq openapiReq;

	private static GetproductListBean getproductlistBean;
	private static ShenqiGetProductListCall shenqiGetProductListCall;
	
	private static QueryProductListBean queryproductlistBean = new QueryProductListBean();
	private static QueryProductListCall queryproductlistCall = new QueryProductListCall();
	
	private static long autotest_goodsOwnerId = Long.valueOf(EnvSetup
			.getData("autotest_goodsOwnerId"));
	private static long multiCDFCodeGoodsOwnerId = ShenqiUserSet.multiCDFCodeGoodsOwnerId;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取商品列表信息");
	}

	@Before
	public void caseUp() {
		openapiReq = new OpenapiReq();
		openapiReq.setMethod("sq.products.list.get");

		getproductlistBean = new GetproductListBean();
		shenqiGetProductListCall = new ShenqiGetProductListCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(shenqiGetProductListCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	public void verify(String productId, int userId, ProductInfo info) throws Exception {
		
		queryproductlistBean.setProductIdList(Arrays.asList(productId));
		queryproductlistBean.setUserId(userId);
		queryproductlistBean.setPageNo(1);
		queryproductlistBean.setPageSize(10);
		
		queryproductlistCall.setData(queryproductlistBean);
		queryproductlistCall.callService();
		
		OpenProductDto expectProduct = queryproductlistCall.getProductList().get(0);
		
		DataUtil.verifyEquals(expectProduct.getThirdCategoryName(), info.getCategory_name(), "验证category_name");
		DataUtil.verifyEquals("www.ymatou.com/product/" + productId + ".html", info.getProduct_url(), "验证product_url");
		DataUtil.verifyEquals(expectProduct.getCreateTime(), info.getCreate_time(), "验证create_time");
		DataUtil.verifyEquals(expectProduct.getParentMchName(), info.getVendor_name(), "验证vendor_name");
		DataUtil.verifyEquals(expectProduct.getBrandName(), info.getBrand_name(), "验证brand_name");
		DataUtil.verifyEquals(expectProduct.getRemark(), info.getRemark(), "验证remark");
		DataUtil.verifyEquals(expectProduct.getProductName(), info.getProduct_name(), "验证product_name");
		DataUtil.verifyEquals(expectProduct.getBrandId(), info.getBrand_id(), "验证brand_id");
		DataUtil.verifyEquals(expectProduct.getUpdateTime(), info.getUpdate_time(), "验证update_time");
		DataUtil.verifyEquals(expectProduct.getThirdCategoryId(), info.getCategory_id(), "验证category_id");
		DataUtil.verifyEquals(expectProduct.getDeliverType() == 100 ? 1 : 2, info.getDelivery_type(), "验证delivery_type");
		DataUtil.verifyEquals(expectProduct.getProductId(), info.getProduct_id(), "验证product_id");
		DataUtil.verifyEquals(expectProduct.getParentMchId(), info.getVendor_id(), "验证vendor_id");
		
		for (int i = 0; i < info.getSkus().size(); i++) {
			
			CatalogInfo catalogInfo = info.getSkus().get(i);
			
			DataUtil.verifyEquals(expectProduct.getSkuList().get(i)
					.getExtraInfo(), catalogInfo.getExtra_info(),
					"验证extra_info");
			DataUtil.verifyEquals(expectProduct.getSkuList().get(i)
					.getWeightUnit(), catalogInfo.getWeight_unit(),
					"验证weight_unit");
			DataUtil.verifyEquals(expectProduct.getSkuList().get(i)
					.getSaleCurrency(), catalogInfo.getCurrency_type(),
					"验证currency_type");
			DataUtil.verifyDecimalEquals(expectProduct.getSkuList().get(i)
					.getSalePrice(), catalogInfo.getPrice(),
					"验证price");
			DataUtil.verifyEquals(expectProduct.getSkuList().get(i)
					.getWeight(), catalogInfo.getWeight(),
					"验证weight");
			DataUtil.verifyEquals(expectProduct.getSkuList().get(i)
					.isEnable(), catalogInfo.getUsed(),
					"验证used");
			DataUtil.verifyEquals(expectProduct.getSkuList().get(i)
					.getBuyingCurrency(), catalogInfo.getVendor_currency(),
					"验证vendor_currency");
			DataUtil.verifyDecimalEquals(expectProduct.getSkuList().get(i)
					.getBuyingPrice(), catalogInfo.getVendor_price(),
					"验证vendor_price");
			
			for (int j = 0; j < catalogInfo.getProperties().size(); j++) {
				
				PropertyInfo propertyInfo = catalogInfo.getProperties().get(j);
				
				DataUtil.verifyEquals(expectProduct.getSkuList().get(i)
						.getCatalogPropertyList().get(j).getPropertyName(),
						propertyInfo.getName(), "验证name");
				DataUtil.verifyEquals(expectProduct.getSkuList().get(i)
						.getCatalogPropertyList().get(j).getPropertyUrl(),
						propertyInfo.getPic_url(), "验证pic_url");
				DataUtil.verifyEquals(expectProduct.getSkuList().get(i)
						.getCatalogPropertyList().get(j).getPropertyValue(),
						propertyInfo.getValue(), "验证value");
			}
		}
	}

	@SuppressWarnings({ "static-access" })
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_sqGetProductList_001() {
		Logger.start(true, "不传入更新时间，获取单个商品详细信息");
		try {

			String productID = DGSQBuildProxyChainCallService
					.createMultiCodeProxychain((int) multiCDFCodeGoodsOwnerId,
							false).getProductId();

			String productID2 = DGSQBuildProxyChainCallService
					.createMultiCodeProxychain((int) multiCDFCodeGoodsOwnerId,
							false).getProductId();
			
//			String productID = "p1479734";
//			String productID2 = "p1479735";

			Thread.sleep(1000);

			List<String> productid_list = new ArrayList<>();
			productid_list.add(productID);
			productid_list.add(productID2);

			getproductlistBean.setProductid_list(productid_list);
			getproductlistBean.setPage_no(1);
			getproductlistBean.setPage_rows(10);

			OpenApiWapper openApiWapper = new OpenApiWapper();

			Application application = openApiWapper
					.selectApplicationBySellerId(multiCDFCodeGoodsOwnerId).get(0);

			String app_id = application.getApp_id();
			String app_secret = application.getApp_secret();

			AuthCode authCode = openApiWapper.selectAuthCodeByAppId(app_id)
					.get(0);

			openapiReq.setApp_id(app_id);
			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(authCode.getAuth_code());
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(getproductlistBean));
			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			String url = String
					.format("http://apigateway.ymatou.com/apigateway/v1?app_id=%s&method=sq.products.list.get",
							app_id);
			shenqiGetProductListCall.setUrl(url);

			shenqiGetProductListCall.setData(openapiReq);
			shenqiGetProductListCall.callService();

			Logger.verifyEquals("0000", shenqiGetProductListCall.getCode(),
					"验证返回Code");

			ProductList ProductList = shenqiGetProductListCall.getProductList();
			Logger.verifyEquals(2, ProductList.getTotal_count(),
					"验证返回total_count");
			
			for (int i = 0; i < ProductList.getProduct_infos().size(); i ++) {
				this.verify(productid_list.get(i), (int) multiCDFCodeGoodsOwnerId,
						ProductList.getProduct_infos().get(i));
			}
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@SuppressWarnings("static-access")
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_sqGetProductList_002() {
		Logger.start(true, "商品Id null-查所有商品");
		try {
			
			getproductlistBean.setPage_no(1);
			getproductlistBean.setPage_rows(10);

			OpenApiWapper openApiWapper = new OpenApiWapper();

			Application application = openApiWapper
					.selectApplicationBySellerId(500004881L)
					.get(0);

			String app_id = application.getApp_id();
			String app_secret = application.getApp_secret();

			AuthCode authCode = openApiWapper.selectAuthCodeByAppId(app_id)
					.get(0);

			openapiReq.setApp_id(app_id);
			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(authCode.getAuth_code());
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(getproductlistBean));
			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			String url = String
					.format("http://apigateway.ymatou.com/apigateway/v1?app_id=%s&method=sq.products.list.get",
							app_id);
			shenqiGetProductListCall.setUrl(url);

			shenqiGetProductListCall.setData(openapiReq);
			shenqiGetProductListCall.callService();

			Logger.verifyEquals("0000", shenqiGetProductListCall.getCode(),
					"验证返回Code");

			ProductList ProductList = shenqiGetProductListCall.getProductList();
			Logger.verifyEquals(true, ProductList.getTotal_count() > 0,
					"验证返回total_count");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@SuppressWarnings("static-access")
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_sqGetProductList_003() {
		Logger.start(true, "商品Id不存在");
		try {

			Thread.sleep(1000);

			List<String> productid_list = new ArrayList<>();
			productid_list.add(TestDataManager.getRandomNum(8));
			productid_list.add(TestDataManager.getRandomNum(8));
			productid_list.add(TestDataManager.getRandomNum(8));
			productid_list.add(TestDataManager.getRandomNum(8));

			getproductlistBean.setProductid_list(productid_list);
			getproductlistBean.setPage_no(1);
			getproductlistBean.setPage_rows(10);

			OpenApiWapper openApiWapper = new OpenApiWapper();

			Application application = openApiWapper
					.selectApplicationBySellerId(this.autotest_goodsOwnerId)
					.get(0);

			String app_id = application.getApp_id();
			String app_secret = application.getApp_secret();

			AuthCode authCode = openApiWapper.selectAuthCodeByAppId(app_id)
					.get(0);

			openapiReq.setApp_id(app_id);
			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(authCode.getAuth_code());
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(getproductlistBean));
			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			String url = String
					.format("http://apigateway.ymatou.com/apigateway/v1?app_id=%s&method=sq.products.list.get",
							app_id);
			shenqiGetProductListCall.setUrl(url);

			shenqiGetProductListCall.setData(openapiReq);
			shenqiGetProductListCall.callService();

			Logger.verifyEquals("0000", shenqiGetProductListCall.getCode(),
					"验证返回Code");

			ProductList ProductList = shenqiGetProductListCall.getProductList();
			Logger.verifyEquals(0, ProductList.getTotal_count(),
					"验证返回total_count");
			Logger.verifyEquals(0, ProductList.getProduct_infos().size(),
					"验证返回Product_infos");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@SuppressWarnings("static-access")
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_sqGetProductList_004() {
		Logger.start(true, "商品Id与Seller不匹配");
		try {
			int sellerId = Integer.valueOf(EnvSetup.getData("SellerId2"));
			String sellerName = EnvSetup.getData("SellerName");

			org.json.JSONObject addNewProductOnSaleObject = SellerProductCallService
					.addNewProductOnSale(sellerId, sellerName, null);
			String productID1 = addNewProductOnSaleObject.getJSONObject("Data")
					.optString("ProductId");

			addNewProductOnSaleObject = SellerProductCallService
					.addNewProductOnSale(sellerId, sellerName, null);
			String productID2 = addNewProductOnSaleObject.getJSONObject("Data")
					.optString("ProductId");

			addNewProductOnSaleObject = SellerProductCallService
					.addNewProductOnSale(sellerId, sellerName, null);
			String productID3 = addNewProductOnSaleObject.getJSONObject("Data")
					.optString("ProductId");

			addNewProductOnSaleObject = SellerProductCallService
					.addNewProductOnSale(sellerId, sellerName, null);
			String productID4 = addNewProductOnSaleObject.getJSONObject("Data")
					.optString("ProductId");

			Thread.sleep(1000);

			List<String> productid_list = new ArrayList<>();
			productid_list.add(productID1);
			productid_list.add(productID2);
			productid_list.add(productID3);
			productid_list.add(productID4);

			getproductlistBean.setProductid_list(productid_list);
			getproductlistBean.setPage_no(1);
			getproductlistBean.setPage_rows(10);

			OpenApiWapper openApiWapper = new OpenApiWapper();

			Application application = openApiWapper
					.selectApplicationBySellerId(
							Long.valueOf(EnvSetup.getData("productsellerid")))
					.get(0);

			String app_id = application.getApp_id();
			String app_secret = application.getApp_secret();

			AuthCode authCode = openApiWapper.selectAuthCodeByAppId(app_id)
					.get(0);

			openapiReq.setApp_id(app_id);
			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(authCode.getAuth_code());
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(getproductlistBean));
			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			String url = String
					.format("http://apigateway.ymatou.com/apigateway/v1?app_id=%s&method=sq.products.list.get",
							app_id);
			shenqiGetProductListCall.setUrl(url);

			shenqiGetProductListCall.setData(openapiReq);
			shenqiGetProductListCall.callService();

			Logger.verifyEquals("0000", shenqiGetProductListCall.getCode(),
					"验证返回Code");

			ProductList ProductList = shenqiGetProductListCall.getProductList();
			Logger.verifyEquals(0, ProductList.getTotal_count(),
					"验证返回total_count");
			Logger.verifyEquals(0, ProductList.getProduct_infos().size(),
					"验证返回Product_infos");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@SuppressWarnings({ "static-access" })
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_sqGetProductList_005() {
		Logger.start(true, "传入商品上架的开始和结束时间，时间区内没有任何商品");
		try {
			Thread.sleep(1000);

			List<String> productid_list = new ArrayList<>();

			getproductlistBean.setProductid_list(productid_list);
			getproductlistBean.setPage_no(1);
			getproductlistBean.setPage_rows(10);
			getproductlistBean.setStart_updated("2010-07-19 13:25:51");
			getproductlistBean.setEnd_updated("2010-10-19 20:25:51");

			OpenApiWapper openApiWapper = new OpenApiWapper();

			Application application = openApiWapper
					.selectApplicationBySellerId(
							Long.valueOf(EnvSetup.getData("productsellerid")))
					.get(0);

			String app_id = application.getApp_id();
			String app_secret = application.getApp_secret();

			AuthCode authCode = openApiWapper.selectAuthCodeByAppId(app_id)
					.get(0);

			openapiReq.setApp_id(app_id);
			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(authCode.getAuth_code());
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(getproductlistBean));
			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			String url = String
					.format("http://apigateway.ymatou.com/apigateway/v1?app_id=%s&method=sq.products.list.get",
							app_id);
			shenqiGetProductListCall.setUrl(url);

			shenqiGetProductListCall.setData(openapiReq);
			shenqiGetProductListCall.callService();

			Logger.verifyEquals("0000", shenqiGetProductListCall.getCode(),
					"验证返回Code");

			ProductList ProductList = shenqiGetProductListCall.getProductList();
			Logger.verifyEquals(0, ProductList.getTotal_count(),
					"验证返回total_count");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@SuppressWarnings({ "static-access" })
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_sqGetProductList_006() {
		Logger.start(true, "传入商品上架的开始和结束时间，查找时间区间内的商品");
		try {

			List<String> productid_list = new ArrayList<>();

			getproductlistBean.setProductid_list(productid_list);
			getproductlistBean.setPage_no(1);
			getproductlistBean.setPage_rows(1);
			getproductlistBean.setStart_updated("2019-03-20 13:25:51");
			getproductlistBean.setEnd_updated("2019-03-29 20:00:00");

			OpenApiWapper openApiWapper = new OpenApiWapper();

			Application application = openApiWapper
					.selectApplicationBySellerId(this.autotest_goodsOwnerId)
					.get(0);

			String app_id = application.getApp_id();
			String app_secret = application.getApp_secret();

			AuthCode authCode = openApiWapper.selectAuthCodeByAppId(app_id)
					.get(0);

			openapiReq.setApp_id(app_id);
			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(authCode.getAuth_code());
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(getproductlistBean));
			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			String url = String
					.format("http://apigateway.ymatou.com/apigateway/v1?app_id=%s&method=sq.products.list.get",
							app_id);
			shenqiGetProductListCall.setUrl(url);

			shenqiGetProductListCall.setData(openapiReq);
			shenqiGetProductListCall.callService();

			Logger.verifyEquals("0000", shenqiGetProductListCall.getCode(),
					"验证返回Code");

			ProductList ProductList = shenqiGetProductListCall.getProductList();
			Logger.verifyEquals(189, ProductList.getTotal_count(),
					"验证返回total_count");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@SuppressWarnings({ "static-access" })
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_sqGetProductList_007() {
		Logger.start(true, "传入商品上架的开始、结束时间和指定的商品，无视时间区间内的商品，只查找指定商品信息");
		try {
			
			String productID = "p1479734";
			String productID2 = "p1479735";

			List<String> productid_list = new ArrayList<>();
			productid_list.add(productID);
			productid_list.add(productID2);

			getproductlistBean.setProductid_list(productid_list);
			getproductlistBean.setPage_no(1);
			getproductlistBean.setPage_rows(10);
			getproductlistBean.setStart_updated("2017-07-19 13:25:51");
			getproductlistBean.setEnd_updated("2017-10-19 20:25:51");

			OpenApiWapper openApiWapper = new OpenApiWapper();

			Application application = openApiWapper
					.selectApplicationBySellerId(500004881L).get(0);

			String app_id = application.getApp_id();
			String app_secret = application.getApp_secret();

			AuthCode authCode = openApiWapper.selectAuthCodeByAppId(app_id)
					.get(0);

			openapiReq.setApp_id(app_id);
			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(authCode.getAuth_code());
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(getproductlistBean));
			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			String url = String
					.format("http://apigateway.ymatou.com/apigateway/v1?app_id=%s&method=sq.products.list.get",
							app_id);
			shenqiGetProductListCall.setUrl(url);

			shenqiGetProductListCall.setData(openapiReq);
			shenqiGetProductListCall.callService();

			Logger.verifyEquals("0000", shenqiGetProductListCall.getCode(),
					"验证返回Code");

			ProductList ProductList = shenqiGetProductListCall.getProductList();
			Logger.verifyEquals(2, ProductList.getTotal_count(),
					"验证返回total_count");
			
			for (int i = 0; i < ProductList.getProduct_infos().size(); i ++) {
				this.verify(productid_list.get(i), 500004881, ProductList.getProduct_infos().get(i));
			}

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@SuppressWarnings("static-access")
	@Test
	@Category({ P1.class })
	@TestCase
	@Ignore
	/*
	 * stag 霓虹买买买 select * from application where seller_id=15511872 ; select *
	 * from auth_code where seller_id=15511872 ;
	 */
	public void Tc_GetProductList_005() {
		Logger.start(true, "获取单个商品详细信息-stg");
		try {

			String app_id = "0Y6XVHaj7kjsoEcvGg";
			String app_secret = "5340AA34A5D6A154066F5074B31BA672149B88B399F6611450BB931952F3EE3277A049D2CAB92FF1E467219E19726988";
			String auth_code = "04MvSmEWQvF07g4U98uHsViKAJYlot5r";

			String productID1 = "76896270-bbc1-4d15-9238-59633f6d1c6e";
			/*
			 * String productID2 = "3a08d75b-6d7b-44f8-bb08-5867f1eb08bc";
			 * String productID3 = "256ba993-6400-49d4-83b9-02bb6fdac235";
			 * String productID4 = "8402ed6a-383b-42ca-914e-ea158e65f299";
			 */

			List<String> productid_list = new ArrayList<>();
			productid_list.add(productID1);

			/*
			 * productid_list.add(productID2); productid_list.add(productID3);
			 * productid_list.add(productID4);
			 */

			getproductlistBean.setProductid_list(productid_list);
			getproductlistBean.setPage_no(1);
			getproductlistBean.setPage_rows(10);

			openapiReq.setApp_id(app_id);
			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(auth_code);
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(getproductlistBean));

			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			String url = String
					.format("https://open.ymatou.com/apigateway/v1?app_id=%s&method=ymatou.products.list.get",
							app_id);
			shenqiGetProductListCall.setUrl(url);

			shenqiGetProductListCall.setData(openapiReq);
			shenqiGetProductListCall.callService();

			Logger.verifyEquals("0000", shenqiGetProductListCall.getCode(),
					"验证返回Code");

			ProductList ProductList = shenqiGetProductListCall.getProductList();

			Logger.info("Total_count:" + ProductList.getTotal_count());

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}